<template>
  <!--我的账单-->
  <div id="reportDetail">
    <div class="header">
      <div class="header_l">累计收益</div>
      <div class="header_r">
        <img src="/static/imgs/qian.png" alt />
        <span class="qian">{{formatDatares.sumAmount}}</span>
        <span class="cny">(CNY)</span>
      </div>
    </div>
    <div class="cent" v-for="(item,index) in fnlist" :key="index">
      <div class="cent_t">
        <div class="research_l_l">
          <div class="resea_l"></div>
          <!-- 喜家德昌平店午餐任务调研 -->
          <div class="resea_r">{{item.restaurant_name}}{{item.task_name}}调研</div>
        </div>
        <div class="research_l_r">任务金额：{{item.reward}}</div>
        <div class="research_l_r research_l_r">{{item.deal_date}}</div>
      </div>
      <div class="cent_b">
        <div class="cent_b_l">
          <img src="/static/imgs/qian.png" alt />
          <span class="research_r_r">{{item.amount}}</span>
        </div>
        <div class="cent_b_r">
          <img src="/static/imgs/shifa.png" alt />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { setStorage, getStorage } from "../../utils/storage";
export default {
  data() {
    return {
      fnlist: [],
      userInfo: {}, // 获取用户信息
      // 列表传值
      fnObj: {
        customer_id: "", // 嘉宾id
        current: 1, // 分页-当前页面
        size: 999 // 分页-每页返回条数
      },
      formatDatares: {} // 接口的全部信息
    };
  },
  methods: {
    fnInitialize() {
      //  获取我的账单接口
      this.$http
        .post({
          url: "/mobile/api/mybill",
          data: this.fnObj
        })
        .then(res => {
          this.fnlist = res.data.bills.list; // 列表数组
          this.formatDatares = res.data; // 接口的全部信息
        });
    }
  },
  async mounted() {
    this.userInfo = await getStorage("userInfo"); // 获取用户信息
    this.fnObj.customer_id = this.userInfo.customer_id; // 获取嘉宾id
    this.fnInitialize(); // 列表接口
  }
};
</script>

<style lang='less'>
page {
  background: rgba(249, 249, 249, 1);
}
#reportDetail {
  background: rgba(249, 249, 249, 1);
}
.header {
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
  background: #fff;
  height: 112px;
}
.header_l {
  width: 100%;
  height: 56px;
  font-size: 16px;
  font-family: PingFangSC-Medium, PingFang SC;
  font-weight: 500;
  color: rgba(0, 0, 0, 1);
  line-height: 56px;
  letter-spacing: 1px;
}
.header_r {
  width: 100%;
  display: flex;
  justify-content: left;
  align-items: center;
}
.header_r img {
  width: 14px;
  height: 18px;
}
.qian {
  font-size: 30px;
  padding-left: 12px;
  font-family: Helvetica;
  color: rgba(219, 74, 55, 1);
  line-height: 36px;
  letter-spacing: 2px;
}
.cny {
  font-size: 16px;
  font-family: Helvetica;
  color: rgba(219, 74, 55, 1);
  line-height: 29px;
  letter-spacing: 1px;
}
.cent {
  width: 355px;
  min-height: 98px;
  background: rgba(255, 255, 255, 1);
  border-radius: 4px;
  margin: 10px auto;
  display: flex;
  justify-content: space-between;
}
.cent_t {
  width: 234px;
}
.research_l_l {
  display: flex;
  justify-content: left;
  width: 100%;
  padding-top: 10px;
  box-sizing: border-box;
  line-height: 25px;
  align-content: center;
}
.resea_l {
  width: 2px;
  align-content: center;
  height: 12px;
  margin: 6px 8px 0 7px;
  background: rgba(86, 150, 255, 1);
}
.resea_r {
  // height:40px;
  font-size: 14px;
  font-family: PingFangSC-Semibold, PingFang SC;
  font-weight: 600;
  color: rgba(0, 0, 0, 1);
  // line-height:40px;
}
.research_l_r {
  font-size: 14px;
  font-family: PingFangSC-Semibold, PingFang SC;
  font-weight: 600;
  color: rgba(102, 102, 102, 1);
  line-height: 25px;
  padding-left: 20px;
}
.research_l_r {
  box-sizing: border-box;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
}
.cent_b {
  width: 111px;
}
.cent_b_l {
  display: flex;
  justify-content: left;
  font-size: 20px;
  font-family: Helvetica;
  align-items: center;
  color: rgba(219, 74, 55, 1);
  line-height: 60px;
  letter-spacing: 1px;
}
.cent_b_l img {
  width: 9px;
  height: 9px;
}
.cent_b_r {
  width: 69px;
  height: 17px;
}
.cent_b_r img {
  width: 69px;
  height: 17px;
}
</style>
